/*
 * @Author: DaHuaZhuXi
 * @Date: 2020-11-11 21:16:01
 * @LastEditTime: 2020-11-18 10:33:08
 * @LastEditors: DaHuaZhuXi
 * @Description:
 */
import Vue from 'vue';
import VueRouter, { RouteConfig } from 'vue-router';
import login from '../views/user/login/Index.vue';
import layout from '../views/layout/Index.vue';

Vue.use(VueRouter);

const routes: Array<RouteConfig> = [
  {
    path: '/login',
    name: 'login',
    component: login,
  },
  {
    path: '/',
    name: 'layout',
    component: layout,
    redirect: '/home',
    children: [
      {
        path: '/home',
        name: 'home',
        component: () => import(/* webpackChunkName: "article" */ '../views/home/Index.vue'),
      },
      {
        path: '/article/manage',
        name: 'article',
        component: () => import(/* webpackChunkName: "article" */ '../views/article/manage/Index.vue'),
      },
      {
        path: '/article/add',
        name: 'articleAdd',
        component: () => import(/* webpackChunkName: "articleAdd" */ '../views/article/add/Index.vue'),
      },
    ],
  },
];

const router = new VueRouter({
  routes,
});

export default router;
